﻿#ifndef FCAMERA_H
#define FCAMERA_H

#include <QObject>
#include <QSize>
#include <QMutex>

#include "qtffmpegcore.h"


class FCamera : public QtFfmpegCore
{
    Q_OBJECT
public:
    explicit FCamera(QObject *parent = nullptr);

    bool openDev(const QString &url) override;
    void closeDev() override;

signals:

private:
    bool initCamera(const QString & dev);
    bool initVideoDecoder(void);
    bool initBuffer(void);
    void freeDev() override;

private:
    int m_videoIndex = -1;

    QSize m_imageSize;
    double m_frameRate = 0.0;

    AVPacket * m_packet = nullptr;
    AVFrame * m_frame = nullptr;
};

#endif // FCAMERA_H
